package com.design_mode;

/**
 * Created by dustaple on 8/4/14.
 */
public class AdapterPattern {
    public static void main(String[] args) {
        IPlug2In plug2In = new Adapter3In();
        plug2In.acceptInsert();
    }
}

abstract class APlug3Pin {
    String negative = "零线";
    String positive = "火线";
    String ground = "地线";

    public abstract void insertInto();
}

interface IPlug2In {
    void acceptInsert();
}

class OnePlug3Pin extends APlug3Pin {
    @Override
    public void insertInto() {
        System.out.println("插入火线");
        System.out.println("插入零线");
        System.out.println("插入地线");
    }
}

class Adapter3In extends OnePlug3Pin implements IPlug2In {

    @Override
    public void acceptInsert() {
         super.insertInto();
    }
}